﻿package jokers{
	//黄 白 蓝 红 粉 橙 绿 铁
	
    public class JCondition {
		public static function getWinInfo():String{
			var ret:String = "";
			switch(JPara.currentCpt){
				case 0:{
					ret = "未消除的颜色：";
					if(JPara.num_crystal[0] == 0) ret += "黄 ";
					if(JPara.num_crystal[1] == 0) ret += "白 ";
					if(JPara.num_crystal[2] == 0) ret += "蓝 ";
					if(JPara.num_crystal[3] == 0) ret += "红 ";
					if(JPara.num_crystal[4] == 0) ret += "粉 ";
					if(JPara.num_crystal[5] == 0) ret += "橙 ";
					if(JPara.num_crystal[6] == 0) ret += "绿 ";
					break;
				}
				case 1:{
					if(JPara.powerHas == 0){
						ret = "能量：" + int(JPara.power) + "/" + JPara.POWER_LENGTH;
					}else{
						ret = "能量：收集完成！";
					}
					break;
				}
				case 2:{
					ret = "最大连击：" + JPara.max_combo + "/8";
					break;
				}
				case 3:{
					ret = "已经获得放大镜：" + JPara.num_tool[JTool.TOOL_SEARCH] + "/5";
					break;
				}
			}
			return ret;
		}
		
		//--------------------------------------------------------------------------
		
		public static function checkWin():Boolean{
			var i:int;
			
			switch(JPara.currentCpt){
				case 0:{
					for(i = 0 ; i < 7 ; i++){
						if(JPara.num_crystal[i] == 0){
							return false;
						}
					}
					return true;
				}
				case 1:{
					return JPara.powerHas > 0;
				}
				case 2:{
					return JPara.max_combo >= 8;
				}
				case 3:{
					return JPara.num_tool[JTool.TOOL_SEARCH] >= 5;
				}
			}
			return false;
		}
	}
}